<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:replace="layouts::header"></head>

<body>
<nav th:replace="layouts::navbar"></nav>
<div class="container">
    <form th:action="@{/forums/save}" th:object="${forum}" method="POST">
        <!--        <input type="text" placeholder="动态" th:field="${forum.name}">-->
<!--                <select th:field="${forum.stage}">-->
        <!--用于更新动态时获得被点击的动态的ID-->
        <input type="hidden" th:field="${forum.blogId}">
        <div class="form-group">
            <div class="col-sm-6">
        <input type="text" placeholder="标题" th:field="${forum.title}">
        </div>
        </div>
        <br>
        <div class="form-group">
            <div class="col-sm-6">
        <input id="time" type="text" placeholder="发布时间" th:field="${forum.postTime}">
            </div>
        </div>
        <br>
        <div class="form-group">
            <div class="col-sm-6">
        <input  type="text" placeholder="发布者ID" th:field="${forum.unitId}">
            </div>
        </div>
        <br>
<!--                </select>-->
        <div class="form-group">
            <div class="col-sm-6">
        <textarea type="text" placeholder="内容" th:field="${forum.content}"></textarea>
            </div>
        </div>
        <br>

        <button class="btn btn-info" type="submit">新建动态</button>
    </form>
</div>
<script>
       document.getElementById("time").value=new Date();

    </script>

</body>
</html>